﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true"
    CodeBehind="MSearch.aspx.cs" Inherits="RN.ERP.Web.Material.Material.MSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../../Scripts/ligerUI/js/plugins/ligerGrid.js"></script>
    <script type="text/javascript" src="../../Scripts/ligerUI/js/plugins/ligerLayout.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        $(function () {

            $("#SpecTree").ligerTree({
                nodeWidth: 300,
                url: 'MaterialHandler.ashx?pid=0',
                attribute: ['nodename', 'id'],
                onBeforeExpand: onBeforeExpand,
                isExpand: function (e) {
                    var data = e.data;
                    return data.isexpand;
                },
                onCheck: onCheck,
                checkbox: true,
                single: true,
                slide: true
            });

            manager = $("#SpecTree").ligerGetTreeManager();
            function onBeforeExpand(note) {
                var data = note.data;
                //防止重复加载,使用isloaded 标记
                if ($("#" + note.data.id).data("isloaded")) {
                    return;
                }
                manager.loadData(note.target, 'MaterialHandler.ashx?pid=' + data.id);
                $("#" + note.data.id).data("isloaded", true);
            }
            function onCheck(node, checked) {
                if (checked) {
                    $("#hdnMCCode").val(node.data.id);
                    $("#hdnMCName").val(node.data.text);
                }
                //                $.getJSON('<%=Page.ResolveUrl("~/Person/PersonExpSpecialityInfo.aspx")%>', { "action": "GetSpecTitle", "id": note.data.id, "rand": Math.random() }, function (data) {
                //                    if (data.Result == true) {
                //                        $("#lblTitle").html(data.Message);
                //                    }
                //                });
            }

        })
        function CloseWin() {
            parent.window.CloseWin("1");
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
        }

        function returnToParent(result) {
            var oArg = {};
            oArg.Result = result;
            if (result > 0) {
                $.ajax({
                    async: false,
                    url: "MSearch.aspx/GetCondition",
                    type: "post",
                    cache: false,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        oArg.condition = data;
                    }
                });
            }
            closeCertChildWin(oArg);
        }

        function returnToP(condition) {
            var oArg = {};
            oArg.Result = 1;
            oArg.condition = condition;
            closeCertChildWin(oArg);
        }
        /*关闭窗口事件*/
        function closeCertChildWin(oArg) {
            parent.window.OnClientCloseCertType(oArg);
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
            parent.window.focus(); //返回焦点
        }
    </script>
    <style type="text/css">
        .cell-label
        {
            width: 80px;
        }
        #tabcontainer .l-tab-links
        {
            border-top: 1px solid #D0D0D0;
            border-left: 1px solid #D0D0D0;
            border-right: 1px solid #D0D0D0;
        }
        
        .projectgrid .l-selected .l-grid-row-cell, .projectgrid .l-selected
        {
            background: none;
        }
        
        .access-icon
        {
            background: url(../images/checkbox.gif) 0px 0px;
            height: 13px;
            line-height: 13px;
            width: 13px;
            margin: 4px 20px;
            display: block;
            cursor: pointer;
        }
        .access-icon-selected
        {
            background-position: 0px -13px;
        }
        .l-panel td.l-grid-row-cell-editing
        {
            padding-bottom: 2px;
            padding-top: 2px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link type="text/css" href="../../CSS/base.css" rel="Stylesheet" />
    <link type="text/css" href="../../CSS/global.css" rel="Stylesheet" />
    <link type="text/css" href="../../CSS/style.css" rel="Stylesheet" />
    <link type="text/css" href="../../CSS/detail.css" rel="Stylesheet" />
    <div id="navReg" class="xx_m">
        物资类别信息</div>
    <br>
    <div position="left" title="物资类别" id="mainmenu">
        <ul id="maintree">
        </ul>
    </div>
    <table style="margin: 5px 0" width="100%">
        <tbody>
            <tr>
                <td align="center">
                    <asp:Button ID="btnSearch" runat="server" CssClass="btn-blue" OnClick="btnSearch_Click"
                        Text="查询"></asp:Button>
                    <input type="button" value="取消" class="btn" onclick="returnToParent(0);" />
                </td>
            </tr>
        </tbody>
    </table>
    <div id="tabs" style="margin: auto;">
        <div id="page1">
            <div class="table-wrapper">
                <table id="page1_block1" align="center" border="0" class="App_TableBlock" width="100%"
                    cellspacing="0">
                    <tbody>
                        <tr>
                            <td colspan="2" class="TableHeader">
                                基本信息
                            </td>
                        </tr>
                        <tr>
                            <td class="TableLabel" width="50" nowrap="">
                                <span title="" class="TableContent  ">物资名称</span>
                            </td>
                            <td class="TableData Width40">
                                <input type="text" name="account_business" id="txtName" class="rn-input-text" maxlength="100"
                                    title="物资名称" datatype="text" readonly="readonly" runat="server">
                            </td>
                        </tr>
                        <tr>
                            <td class="TableLabel" width="50" nowrap="">
                                <span title="" class="TableContent  ">物资分类</span>
                            </td>
                            <td class="TableData Width40">
                                <input type="text" name="account_business" id="Text1" class="rn-input-text" maxlength="100"
                                    title="物资分类" datatype="text" readonly="readonly" runat="server">
                                <a href="javascript:void(0)" title="选择物资分类" class="imgZoom" id="A1" style="background-image: url('../../Styles/skins/ytblue/images/magnifying.jpg');
                                    background-repeat: no-repeat"></a>
                                <asp:HiddenField ID="HiddenField1" runat="server" ClientIDMode="Static" />
                                <asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" />
                            </td>
                        </tr>
                        <tr>
                            <td class="TableLabel" width="50" nowrap="">
                                <span title="" class="TableContent  ">物资数量</span>
                            </td>
                            <td class="TableData Width40">
                                <input type="text" name="account_business" id="txtMNum" class="rn-input-text"
                                    maxlength="100" title="物资数量" datatype="text" readonly="readonly" runat="server">单位:<asp:DropDownList
                                        ID="ddlUnit" runat="server" Width="60"></asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="TableLabel" width="50" nowrap="">
                                <span title="" class="TableContent  ">物资估算单价</span>
                            </td>
                            <td class="TableData Width40">
                                <input type="text" name="account_business" id="txtMEval" class="rn-input-text"
                                    maxlength="100" title="物资估算单价" datatype="text" readonly="readonly" runat="server">
                            </td>
                        </tr>
                        <tr>
                            <td class="TableLabel" width="50" nowrap="">
                                <span title="" class="TableContent  ">物资特性</span>
                            </td>
                            <td class="TableData Width40">
                                <asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatDirection="Horizontal"
                                    RepeatLayout="Flow">
                                    <asp:ListItem Value="1">是否可转资产</asp:ListItem>
                                    <asp:ListItem Value="2">是否借用</asp:ListItem>
                                    <asp:ListItem Value="3">是否销售</asp:ListItem>
                                    <asp:ListItem Value="4">是否出样</asp:ListItem>
                                </asp:CheckBoxList>
                            </td>
                        </tr>
                        <tr>
                            <td class="TableLabel" width="50" nowrap="">
                                <span title="" class="TableContent  ">物资属性类型</span>
                            </td>
                            <td class="TableData Width40">
                                <asp:DropDownList ID="ddlMPClass" runat="server" Width="50%" AutoPostBack="True"
                                    OnSelectedIndexChanged="ddlMPClass_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <asp:Repeater ID="rptMPInfo" runat="server" OnItemDataBound="rptMPInfo_ItemDataBound">
                            <ItemTemplate>
                                <tr>
                                    <td class="TableLabel" width="50" nowrap="">
                                        <%# Eval("cMPIName")%>
                                    </td>
                                    <td class="TableLabel" width="50" nowrap="">
                                        <asp:HiddenField ID="hdnCode" runat="server" Value='<%# Eval("cMPICode") %>' />
                                        <asp:HiddenField ID="hdniMPIKind" runat="server" Value='<%# Eval("iMPIKind") %>' />
                                        <asp:HiddenField ID="hdncMPIInfo" runat="server" Value='<%# Eval("cMPIInfo") %>' />
                                        <asp:TextBox ID="txtSingle" Width="50%" runat="server" Visible="false" CssClass="rn-input-text"></asp:TextBox>
                                        <asp:TextBox ID="txtMulti" Width="50%" runat="server" Height="50px" Visible="false" CssClass="rn-input-text"
                                            TextMode="MultiLine"></asp:TextBox>
                                        <asp:DropDownList ID="ddlSelect" runat="server" Width="50%" Visible="false">
                                        </asp:DropDownList>
                                        <asp:CheckBoxList ID="cbSelect" runat="server" Width="50%" Visible="false" RepeatDirection="Horizontal"
                                            RepeatLayout="Flow">
                                        </asp:CheckBoxList>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
            </div>
        </div>
        <table style="margin: 5px 0" width="100%">
            <tbody>
                <tr>
                    <td align="center">
                        <asp:Button ID="btnSearch1" runat="server" CssClass="btn-blue" OnClick="btnSearch_Click"
                            Text="查询"></asp:Button>
                        <input type="button" value="取消" class="btn" onclick="" onclick="returnToParent(0);">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    </div>
    </div>
    </div>
</asp:Content>
